package cn.stylefeng.guns.modular.gridsystem.controller;

import cn.stylefeng.guns.core.annotion.BusinessLog;
import cn.stylefeng.guns.core.enums.LogAnnotionOpTypeEnum;
import cn.stylefeng.guns.core.pojo.response.ResponseData;
import cn.stylefeng.guns.core.pojo.response.SuccessResponseData;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import cn.stylefeng.guns.modular.gridsystem.service.BizIndustryInvolvedService;
import cn.stylefeng.guns.modular.gridsystem.model.param.BizIndustryInvolvedParam;

import javax.annotation.Resource;

/**
 * biz_industry_involved 控制器
 *
 * @author: ssy
 * @date: 2021/11/01 15:31
 */
@RestController
public class BizIndustryInvolvedController {

    @Resource
    private BizIndustryInvolvedService bizIndustryInvolvedService;

    /**
     * 分页查询biz_industry_involved
     *
     * @author ssy
     * @date 2021/11/01 15:31
     */
    @GetMapping("/bizIndustryInvolved/page")
    @BusinessLog(title = "biz_industry_involved_分页查询", opType = LogAnnotionOpTypeEnum.QUERY)
    public ResponseData page(BizIndustryInvolvedParam bizIndustryInvolvedParam) {
        return new SuccessResponseData(bizIndustryInvolvedService.page(bizIndustryInvolvedParam));
    }

    /**
     * 获取全部biz_industry_involved
     *
     * @author ssy
     * @date 2021/11/01 15:31
     */
    @GetMapping("/bizIndustryInvolved/list")
    @BusinessLog(title = "biz_industry_involved_查询所有", opType = LogAnnotionOpTypeEnum.QUERY)
    public ResponseData list(BizIndustryInvolvedParam bizIndustryInvolvedParam) {
        return new SuccessResponseData(bizIndustryInvolvedService.list(bizIndustryInvolvedParam));
    }

    /**
     * 查看详情biz_industry_involved
     *
     * @author ssy
     * @date 2021/11/01 15:31
     */
    @GetMapping("/bizIndustryInvolved/detail")
    @BusinessLog(title = "biz_industry_involved_查看详情", opType = LogAnnotionOpTypeEnum.DETAIL)
    public ResponseData detail(@Validated(BizIndustryInvolvedParam.detail.class) BizIndustryInvolvedParam bizIndustryInvolvedParam) {
        return new SuccessResponseData(bizIndustryInvolvedService.detail(bizIndustryInvolvedParam));
    }

    /**
     * 添加biz_industry_involved
     *
     * @author ssy
     * @date 2021/11/01 15:31
     */
    @PostMapping("/bizIndustryInvolved/add")
    @BusinessLog(title = "biz_industry_involved_增加", opType = LogAnnotionOpTypeEnum.ADD)
    public ResponseData add(@RequestBody @Validated(BizIndustryInvolvedParam.add.class) BizIndustryInvolvedParam bizIndustryInvolvedParam) {
        bizIndustryInvolvedService.add(bizIndustryInvolvedParam);
        return new SuccessResponseData();
    }

    /**
     * 删除biz_industry_involved
     *
     * @author ssy
     * @date 2021/11/01 15:31
     */
    @PostMapping("/bizIndustryInvolved/delete")
    @BusinessLog(title = "biz_industry_involved_删除", opType = LogAnnotionOpTypeEnum.DELETE)
    public ResponseData delete(@RequestBody @Validated(BizIndustryInvolvedParam.delete.class) BizIndustryInvolvedParam bizIndustryInvolvedParam) {
        bizIndustryInvolvedService.delete(bizIndustryInvolvedParam);
        return new SuccessResponseData();
    }

    /**
     * 编辑biz_industry_involved
     *
     * @author ssy
     * @date 2021/11/01 15:31
     */
    @PostMapping("/bizIndustryInvolved/edit")
    @BusinessLog(title = "biz_industry_involved_编辑", opType = LogAnnotionOpTypeEnum.EDIT)
    public ResponseData edit(@RequestBody @Validated(BizIndustryInvolvedParam.edit.class) BizIndustryInvolvedParam bizIndustryInvolvedParam) {
        bizIndustryInvolvedService.edit(bizIndustryInvolvedParam);
        return new SuccessResponseData();
    }


}
